package net.oschina.app.viewpagerfragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import net.oschina.app.R;
import net.oschina.app.ui.AttentionFansActivity;
import net.oschina.app.ui.BlogActivity;
import net.oschina.app.ui.CollectionActivity;
import net.oschina.app.ui.MyTeamActivity;
import net.oschina.app.ui.NoteActivity;
import net.oschina.app.ui.view.CircleImageView;
import net.oschina.app.ui.view.MessageCenterActivity;


/**
 * Created by foty on 2017/4/1.
 * ?
 */

public class MeFragment extends Fragment {

    private TextView mCollect;
    private TextView mAttention;
    private TextView mFans;
    private TextView mBlog;
    private TextView mMyMessage;
    private RelativeLayout mRlblog;
    private RelativeLayout mRmessage;
    private RelativeLayout mRnote;
    private RelativeLayout mRteam;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.view_mine, container, false);
        CircleImageView civ = (CircleImageView) view.findViewById(R.id.headface);
        civ.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(getContext(), "666", Toast.LENGTH_SHORT).show();
            }
        });
        mCollect = (TextView) view.findViewById(R.id.collect);
        mCollect.setOnClickListener(new View.OnClickListener() {
            //我的收藏
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getContext(), CollectionActivity.class);
                startActivity(intent);
            }
        });
        mBlog = (TextView) view.findViewById(R.id.myblog);
        mRlblog = (RelativeLayout) view.findViewById(R.id.rl_myblog);
        mRlblog.setOnClickListener(new View.OnClickListener() {
            //我的博客
            @Override
            public void onClick(View v) {
               Intent intent = new Intent(getContext(), BlogActivity.class);
                startActivity(intent);
            }
        });
        mMyMessage = (TextView) view.findViewById(R.id.mymessage);
        mRmessage = (RelativeLayout) view.findViewById(R.id.rl_mymessage);
        mRmessage.setOnClickListener(new View.OnClickListener() {
            //我的消息
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getContext(), MessageCenterActivity.class);
                startActivity(intent);
            }
        });
        mRnote = (RelativeLayout) view.findViewById(R.id.rl_mynote);
        mRnote.setOnClickListener(new View.OnClickListener() {
            //便签
            @Override
            public void onClick(View v) {
//                Toast.makeText(getContext(), "我的便签", Toast.LENGTH_SHORT).show();

                Intent intent = new Intent(getContext(), NoteActivity.class);
                startActivity(intent);
            }
        });
        mRteam = (RelativeLayout) view.findViewById(R.id.rl_myteam);
        mRteam.setOnClickListener(new View.OnClickListener() {
            //团队
            @Override
            public void onClick(View v) {
//                 Toast.makeText(getContext(), "我的团队", Toast.LENGTH_SHORT).show();
                Intent intent = new Intent(getContext(), MyTeamActivity.class);
                startActivity(intent);
            }
        });





        mAttention = (TextView) view.findViewById(R.id.attention);
        mAttention.setOnClickListener(new View.OnClickListener() {
            //关注,粉丝
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getContext(), AttentionFansActivity.class);
                intent.putExtra("isFans",false);


                startActivity(intent);
            }
        });
        mFans = (TextView) view.findViewById(R.id.fans);
        mFans.setOnClickListener(new View.OnClickListener() {
            //关注,粉丝
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getContext(),AttentionFansActivity.class);
                intent.putExtra("isFans",true);
                startActivity(intent);
            }
        });
        return view;
    }

}
